package com.elasticsearch.entity;

import lombok.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author yexi
 */
@Data
@Builder
@Document(indexName = "product")
public class Product {
    @Id
    private String id;

    /**
     * 分词器、搜索分词器
     */
    @Field(analyzer = "ik_smart", searchAnalyzer = "ik_smart", type = FieldType.Text)
    private String title;
    private Integer price;
    @Field(analyzer = "ik_smart", searchAnalyzer = "ik_smart", type = FieldType.Text)
    private String intro;
    @Field(type = FieldType.Keyword)
    private String brand;
}